package com.jbm.core.iface;

/**
 * Created by root on 17-3-4.
 */
public class IConnectAgent extends IAcross
{
	public static final char ca_status_authorized = 5;
	public static final char ca_status_unauthorized = 8;

	public int m_device_id;

	public int m_ca_status;

	public String m_app_type;

	public String m_remotehost;
	public int m_remoteport;
	public int m_localport;

	public int m_acc_id_4_arcross;
	protected final Object m_ca_status_mutex = new Object();

	public IConnectAgent()
	{
		super();

		m_remotehost = null;
		m_remoteport = 0;
		m_localport = 0;

		m_ca_status = ca_status_unauthorized;
	}

	public IConnectAgent(IConnectAgent ia)
	{
		m_device_id = ia.m_device_id;
		m_ca_status = ia.m_ca_status;
		m_app_type = ia.m_app_type;
		m_remotehost = ia.m_remotehost;
		m_remoteport = ia.m_remoteport;
		m_localport = ia.m_localport;
	}

	public IConnectAgent(IAcross ia)
	{
		super(ia);
	}

	public IConnectAgent(String app_type)
	{
		m_app_type = app_type;
	}

	public Integer getM_device_id()
	{
		return m_device_id;
	}

	public String getM_remotehost()
	{
		return m_remotehost;
	}

	public int getM_remoteport()
	{
		return m_remoteport;
	}

	public String getM_app_type()
	{
		return m_app_type;
	}

	public void setM_acc_id_4_arcross(int acc_id_4_arcross)
	{
		m_acc_id_4_arcross = acc_id_4_arcross;
	}

	public int getM_acc_id_4_arcross()
	{
		return m_acc_id_4_arcross;
	}

	public void setM_ca_status(int ca_status )
	{
		synchronized (m_ca_status_mutex)
		{
			m_ca_status = ca_status;
		}
	}

	public int getM_ca_status()
	{
		synchronized (m_ca_status_mutex)
		{
			return m_ca_status;
		}
	}
}
